package cn.iocoder.yudao.module.biz.dal.mysql.htPlanDetailExe;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.htPlanDetailExe.HtPlanDetailExeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.htPlanDetailExe.vo.*;

/**
 * 排查项目计划执行结果 Mapper
 *
 * @author yudao
 */
@Mapper
public interface HtPlanDetailExeMapper extends BaseMapperX<HtPlanDetailExeDO> {

    default PageResult<HtPlanDetailExeDO> selectPage(HtPlanDetailExePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<HtPlanDetailExeDO>()
                .eqIfPresent(HtPlanDetailExeDO::getPlanExeId, reqVO.getPlanExeId())
                .eqIfPresent(HtPlanDetailExeDO::getPlanDetailId, reqVO.getPlanDetailId())
                .eqIfPresent(HtPlanDetailExeDO::getRiskState, reqVO.getRiskState())
                .betweenIfPresent(HtPlanDetailExeDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(HtPlanDetailExeDO::getId));
    }

    default List<HtPlanDetailExeDO> selectList(HtPlanDetailExeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<HtPlanDetailExeDO>()
                .eqIfPresent(HtPlanDetailExeDO::getPlanExeId, reqVO.getPlanExeId())
                .eqIfPresent(HtPlanDetailExeDO::getPlanDetailId, reqVO.getPlanDetailId())
                .eqIfPresent(HtPlanDetailExeDO::getRiskState, reqVO.getRiskState())
                .betweenIfPresent(HtPlanDetailExeDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(HtPlanDetailExeDO::getId));
    }

}
